from likeshop_project.BASE.myBase import Tools
from likeshop_project.API.login_api import login_module

class addAddress_module(Tools):
    path = "api/user_address/add"

    def addAddress_action(self, contact, telephone, province_id, city_id, district_id, address, is_default):
        url = self.host_url + self.path
        data = {
            'contact':contact,
            'telephone': telephone,
            'province_id': province_id,
            'city_id': city_id,
            'district_id': district_id,
            'address': address,
            'is_default': is_default,
        }
        head = login_module(session=self.session).get_head()
        msg = self.session.post(url=url, json=data,headers=head)
        return msg.json()
